package homework.day03;

import java.util.Scanner;

/**
 * @author ThinkBook
 */
public class Test09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输⼊年份：");
        int year = sc.nextInt();
        System.out.println("请输⼊⽉份：");
        int month = sc.nextInt();
        System.out.println("请输⼊⽇期：");
        int day = sc.nextInt();
        sc.close();
        int dayOfYear = 0;
        for (int i = 1; i <= month; i++) {
            if (i == 2) {
                if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
                    dayOfYear += 29;
                } else {
                    dayOfYear += 28;
                }
            } else if (i == 4 || i == 6 || i == 9 || i == 11){
                dayOfYear += 30;
            } else {
                dayOfYear += 31;
            }
        }
        dayOfYear += day;
        System.out.println(year + "年" + month + "⽉" + day + "⽇是该年的第" + dayOfYear + "天");
    }
}
